﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using Microsoft.Practices.EnterpriseLibrary.Data;
using System.Data.Common;
using NLBS.Entity;

namespace NLBS.Data
{
    public partial class NHibernateDataProvider : DbProvider
    {
        #region settings

        public override Dictionary<string, Setting> GetSettings()
        {
            IList<Setting> list = CurrentSession.CreateCriteria(typeof(Setting)).List<Setting>();
            Dictionary<string, Setting> lists = new Dictionary<string, Setting>();
            foreach (var item in list)
            {
                lists.Add(item.Name, item);
            }
            return lists;
        }

        public override void UpdateSettings(Setting set)
        {
            CurrentSession.Save(set);
        }

        #endregion
    }
}
